<template>
  <div class="header">
    <span>基本信息</span>
    <el-button type="primary" plain size="mini" @click="handleIsShow">{{ isShow ? '收缩' : '展示' }}</el-button>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: ''
    },
    defaultShow: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      isShow: this.defaultShow
    }
  },
  methods: {
    handleIsShow() {
      this.isShow = !this.isShow
      this.$emit('handleIsShow', this.isShow)
    }
  }
}
</script>

<style lang="scss" scoped>
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #eee;
  border-left: 2px solid #409eff;
  margin-bottom: 10px;
  padding: 0 10px;
  line-height: 30px;
  span {
    padding: 4px 0;
  }
}
</style>
